
#pragma once
#include <netinet/in.h>
#include "event_loop.h"

class tcp_server
{

public:
    tcp_server(event_loop *loop, const char *ip, uint16_t port);
    ~tcp_server();
    void do_accept();

private:
private:
    int _sockfd;                  // 套接字
    struct sockaddr_in _connaddr; // 客户端链接地址
    socklen_t _addrlen;           // 客户端链接地址
    event_loop *_loop;
};

void lars_hello();